//
//  UILabel+UILabelNightMode.m
//  NightModeDemo
//
//  Created by dllo on 15/12/11.
//  Copyright © 2015年 ZKJ. All rights reserved.
//

#import "UILabel+UILabelNightMode.h"

@implementation UILabel (UILabelNightMode)

- (void)nightMode {
    NSUserDefaults *user = [NSUserDefaults standardUserDefaults];
    NSString *mode = [user objectForKey:@"NightMode"];
    
    if ([mode isEqualToString:@"Night"]) {
        if (self.textColor == [UIColor blackColor]) {
            self.textColor = [UIColor whiteColor];
        } else if (self.textColor == [UIColor grayColor]) {
            self.textColor = [UIColor blueColor];
        }
    } else {
        if (self.textColor == [UIColor whiteColor]) {
            self.textColor = [UIColor blackColor];
        } else if (self.textColor == [UIColor blueColor]) {
            self.textColor = [UIColor grayColor];
        }
    }
}

@end
